<%@ page language="java" contentType="text/html" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    
    <title>My JSP 'index.jsp' starting page</title> 
<meta http-equiv="content" content="text/html;charset=utf-8">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">



function sub()
{

   $.ajax({
   type:"post",
  url:"./test",
   data:{
   username:$("#username").val(),
   content:$("#content").val()
   },
   success:function(data,textStatus){
    $("#resText").html(data);
   }
   });
  
}



   </script>
</head>

<body>

<form action="./test" id="form1" method="post">
<p>Test:</p>
<p>Name:<input type="text" name="username" id="username"/></p>
<p>Content<textarea name="content" id="content" rows="2" cols="20"></textarea></p>
<p><input type="button" id="send" value="submit" onclick="sub();"/></p>
</form>
<div class="comment">
Comments:
</div>
<div id="resText">
</div>

</body>
</html>